package com.bush.mall.order.controller;

import org.springframework.web.bind.annotation.*;
import com.bush.mall.common.entity.Result;;
import com.bush.mall.order.entity.MqMessageEntity;
import com.bush.mall.order.service.MqMessageService;
import javax.annotation.Resource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 
 * @author RUN
 * @date 2022-11-29
 */
@RestController
@RequestMapping("mqmessage")
@Api(tags = "管理" )
public class MqMessageController {

    @Resource(name= MqMessageService.BEAN_ID)
    private MqMessageService mqMessageService;

    /**
     * 分页查询列表
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "分页查询列表")
    @GetMapping("queryForPage")
    public Result queryForPage(Integer current,Integer size){
        return mqMessageService.queryForPage(current,size);
    }

    /**
     * 保存表单
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "保存表单")
    @PostMapping
    public Result saveMqMessage(@RequestBody MqMessageEntity mqMessage){
        return mqMessageService.saveMqMessage(mqMessage);
    }

    /**
     * 修改表单
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "修改表单")
    @PutMapping
    public Result updateMqMessage(@RequestBody MqMessageEntity mqMessage){
        return mqMessageService.updateMqMessage(mqMessage);
    }

    /**
     * 通过指定id删除
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "通过指定id删除")
    @DeleteMapping
    public Result deleteMqMessage(Long id){
        return mqMessageService.deleteMqMessage(id);
    }

}
